function scheduleHtmlParser(html) {
    let result = []
    let c = $('#kbgrid_table_0 .timetable_con')
    for (let u = 0; u < c.length; u++) {
        let re = {sections: [], weeks: []}
        let a = $(c[u]).find('span')
        let b=$(c[u]).find('u')
        let week = $(c[u]).parent('td')[0].attribs.id
        if (week) {
            re.day = week.split('-')[0]
        }
        for (let i = 0; i < b.length; i++) {
            if (b[i].attribs.class && b[i].attribs.class.indexOf('title')!==-1) {
                for (let j = 0; j < b[i].children[0].children.length; j++) {
                    re.name = b[i].children[0].children[j].data
                }
            }
        }
        for (let i = 0; i < a.length; i++) {
            if (a[i].attribs.class && a[i].attribs.class==='title') {
                for (let j = 0; j < a[i].children[0].children.length; j++) {
                    re.name = a[i].children[0].children[j].data
                }
            }
            if (a[i].attribs.title == '上课地点') {
                for (let j = 0; j < a[i].next.children.length; j++) {
                    re.position = a[i].next.children[j].data.split(' ')[3]
                }
            }
            if (a[i].attribs.title == '教师 ') {
                for (let j = 0; j < a[i].next.children.length; j++) {
                    re.teacher = a[i].next.children[j].data
                }
            }
            if (a[i].attribs.title == '节/周') {
                for (let j = 0; j < a[i].next.children.length; j++) {
                    let value = a[i].next.children[j].data
                    //节
                    for (let jie = Number(value.split('(')[1].split(')')[0].split('-')[0]);
                         jie <= Number(value.split('(')[1].split(')')[0].split('-')[1].split('节')[0]); jie++) {
                        re.sections.push(jie)
                    }
                    getWeek(value, re)
                }
            }
        }
        result.push(re)
    }
    return result
}

function getWeek(value, re) {
    //周
    let chang = null
    if (value.split(')')[1].indexOf('-') != -1) {
        chang = Number(value.split(')')[1].split('-')[1].split('周')[0])
        for (let zhou = Number(value.split(')')[1].split('-')[0]);
             zhou <= chang; zhou++) {
            if (value.indexOf('单') != -1 || value.indexOf('双') != -1) {
                //单周
                if (value.indexOf('单') != -1) {
                    if (zhou % 2 != 0) {
                        re.weeks.push(zhou)
                    }
                }
                //双周
                if (value.indexOf('双') != -1) {
                    if (zhou % 2 == 0) {
                        re.weeks.push(zhou)
                    }
                }
            } else {
                re.weeks.push(zhou)
            }
        }
        if (value.indexOf(',') != -1) {
            if (value.split(',')[1].indexOf('-') != -1) {
                chang = Number(value.split(',')[1].split('-')[1].split('周')[0])
                for (let zhou = Number(value.split(',')[1].split('-')[0]); zhou <= chang; zhou++) {
                    re.weeks.push(zhou)
                }
            } else {
                chang = Number(value.split(',')[1].split('周')[0])
                re.weeks.push(zhou)
            }

        }
    } else {
        chang = Number(value.split(')')[1].split('-')[0].split('周')[0])
        re.weeks.push(chang)
    }
}